package com.demo.task.remote

import com.demo.task.bean.PlanBean
import com.demo.task.bean.Response
import com.demo.task.ext.getSerial
import retrofit2.http.Field
import retrofit2.http.FieldMap
import retrofit2.http.FormUrlEncoded
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface ApiService {

    /**
     * 获取轮播数据
     * @param mcc String
     * @param id String
     * @return DataBean
     */
    @POST("api/demo/test2")
    @FormUrlEncoded
    suspend fun getData(
        @Query("mcc") mcc: String = "460",
        @Query("id") id: String = "1",
        @Query("sn") sn: String = "",
        @FieldMap params: Map<String, String>,
    ): Response<PlanBean>

    /**
     * 获取控制数据
     */
    @POST("api/demo/ctNow")
    suspend fun getControl(@Query("sn") sn: String = getSerial()): Response<PlanBean>


    @POST("/index.php/api/demo/uploadScreen")
    @FormUrlEncoded
    suspend fun uploadScreen(
        @Field("urls") url: String,
        @Field("sn") sn: String = getSerial(),
    ): Response<Int>
}